import { ref } from 'vue'
import request from '@/utils/request.js'

//查询所有标签
export const selectAllQuestionType = () => {
  return request.get('/subjectlabel/list')
}
//查询所有题型
export const selectAllQuestionTypeList = (params) => {
  return request.get('/subject/list',{params:params})
}
//查询单选题
export const selectSingleChoice = (params) => {
  return request.get('/subject/listByType',{params:params})
}
//根据标签查询
export const selectSubjectByLabelId = (params) => {
  return request.post('/subject/listByLabel',params)
}
//查询专业
export const selectMajorList = () => {
  return request.get('/subject/major')
}

//导入功能
export const importSubject = (params) => {
  return request.post('/subject/importData',params)
}
//修改头像
export const updatePicService = (avatarUrl) => {
  let params = new URLSearchParams();
  params.append('userAvatar', avatarUrl)
  return request.put('/user/updatePic', params)
};